#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 100000021;
ll n, cnt, prime[N / 2], t;
bool v[N];
const int M = 10010;
ll a[M], cumsum[M];
int main() {
  v[0] = v[1] = 1;
  for (int i = 2; i < N; ++i) {
    if (!v[i]) prime[++cnt] = i;
    for (int j = 1; j <= cnt && i * prime[j] < N; ++j) {
      v[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
  scanf("%lld", &t);
  for (int i = 1; i <= t; ++i) {
    int found = 0;
    scanf("%lld", &n);
    for (int j = 1; j <= n; ++j) scanf("%lld", a + j);
    for (int j = 1; j <= n; ++j) cumsum[j] = a[j] + cumsum[j - 1];
    for (int j = 2; j <= n; ++j) {            // 枚举区间长度
      for (int k = 1; k <= n - j + 1; ++k) {  // 枚举区间左端点
        if (v[cumsum[k + j - 1] - cumsum[k - 1]] == 0) {
          printf("Shortest primed subsequence is length %d:", j);
          for (int p = k; p <= k + j - 1; ++p) printf(" %d", a[p]);
          puts("");
          found = 1;
          break;
        }
      }
      if (found) break;
    }
    if (!found) printf("This sequence is anti-primed.\n");
  }
}
